<!DOCTYPE html>
<html lang="zh">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>现代计算机图形学入门 | Dirac Lee</title><meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="noodp" />
<meta name="Description" content="Dirac Lee 的博客"><link rel="prev" href="https://diraclee.gitee.io/2020/12/%E6%8E%A8%E8%8D%90%E7%B3%BB%E7%BB%9F%E7%BB%BC%E8%BF%B0/" /><link rel="next" href="https://diraclee.gitee.io/2020/12/%E5%85%83%E5%AD%A6%E4%B9%A0%E6%A6%82%E8%A7%88/" /><link rel="canonical" href="https://diraclee.gitee.io/2020/12/%E7%8E%B0%E4%BB%A3%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9B%BE%E5%BD%A2%E5%AD%A6%E5%85%A5%E9%97%A8/" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff"><meta property="og:title" content="现代计算机图形学入门" />
<meta property="og:description" content="" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://diraclee.gitee.io/2020/12/%E7%8E%B0%E4%BB%A3%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9B%BE%E5%BD%A2%E5%AD%A6%E5%85%A5%E9%97%A8/" />
<meta property="article:published_time" content="2020-12-04T00:00:00+00:00" />
<meta property="article:modified_time" content="2020-12-04T00:00:00+00:00" />
<script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "BlogPosting",
        "headline": "现代计算机图形学入门",
        "mainEntityOfPage": {
            "@type": "WebPage",
            "@id": "https:\/\/diraclee.gitee.io\/2020\/12\/%E7%8E%B0%E4%BB%A3%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9B%BE%E5%BD%A2%E5%AD%A6%E5%85%A5%E9%97%A8\/"
        },"image": {
                "@type": "ImageObject",
                "url": "https:\/\/diraclee.gitee.io\/logo.png",
                "width":  800 ,
                "height":  600 
            },"genre": "posts","keywords": "入门, 计算机图形学","wordcount":  2308 ,
        "url": "https:\/\/diraclee.gitee.io\/2020\/12\/%E7%8E%B0%E4%BB%A3%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9B%BE%E5%BD%A2%E5%AD%A6%E5%85%A5%E9%97%A8\/","datePublished": "2020-12-04T00:00:00\x2b00:00","dateModified": "2020-12-04T00:00:00\x2b00:00","license": "This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.","publisher": {
                "@type": "Organization",
                "name": "xxxx",
                "logo": {
                "@type": "ImageObject",
                "url": "https:\/\/diraclee.gitee.io\/logo.png",
                "width":  127 ,
                "height":  40 
                }
            },"description": ""
    }
    </script><link rel="stylesheet" href="/css/style.min.css"><link rel="stylesheet" href="/css/lib/fontawesome-free/all.min.css"><link rel="stylesheet" href="/css/lib/animate/animate.min.css"></head>
    <body><script>
            window.isDark = (window.localStorage && window.localStorage.getItem('theme')) === 'dark';
            window.isDark && document.body.classList.add('dark-theme');
        </script><div class="wrapper"><nav class="navbar">
    <div class="navbar-container">
        <div class="navbar-header animated bounceIn">
            <a href="https://diraclee.gitee.io">Dirac Lee</a>
        </div>
        <div class="navbar-menu"><a class="menu-item" href="https://diraclee.gitee.io/posts" title="">文章</a><a class="menu-item" href="https://diraclee.gitee.io/tags" title="">标签</a><a class="menu-item" href="https://diraclee.gitee.io/categories" title="">分类</a><a class="menu-item" href="https://diraclee.gitee.io/about" title="">关于</a><a class="menu-item" href="https://diraclee.gitee.io" title="English"><i class="fas fa-language fa-fw"></i></a><a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw" title="切换主题"></i></a>
        </div>
    </div>
</nav><nav class="navbar-mobile">
    <div class="navbar-container">
        <div class="navbar-header">
            <div class="navbar-header-title animated bounceIn">
                <a href="https://diraclee.gitee.io">Dirac Lee</a>
            </div>
            <div class="menu-toggle" id="menu-toggle">
                <span></span><span></span><span></span>
            </div>
        </div>
        <div class="navbar-menu" id="mobile-menu"><a class="menu-item" href="https://diraclee.gitee.io/posts" title="">文章</a><a class="menu-item" href="https://diraclee.gitee.io/tags" title="">标签</a><a class="menu-item" href="https://diraclee.gitee.io/categories" title="">分类</a><a class="menu-item" href="https://diraclee.gitee.io/about" title="">关于</a><a class="menu-item" href="https://diraclee.gitee.io" title="English"></a><a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw" title="切换主题"></i></a>
        </div>
    </div>
</nav><main class="main">
                <div class="container"><article class="page"><h1 class="post-title animated flipInX">现代计算机图形学入门</h1><div class="post-meta">
            <div class="post-meta-main"><a class="author" href="https://diraclee.gitee.io" rel="author" target="_blank">
                    <i class="fas fa-user-circle fa-fw"></i>Dirac Lee
                </a>&nbsp;<span class="post-category">收录于&nbsp;<i class="far fa-folder fa-fw"></i><a href="https://diraclee.gitee.io/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9B%BE%E5%BD%A2%E5%AD%A6/">计算机图形学</a>&nbsp;</span></div>
            <div class="post-meta-other"><i class="far fa-calendar-alt fa-fw"></i><time datetime=2020-12-04>2020-12-04</time>&nbsp;
                <i class="fas fa-pencil-alt fa-fw"></i>约 2308 字&nbsp;
                <i class="far fa-clock fa-fw"></i>预计阅读 5 分钟&nbsp;</div>
        </div><div class="post-content"><a class="post-dummy-target" id="一总览"></a><h2>一、总览</h2>
<ul>
<li>
<p>总览</p>
</li>
<li>
<p>叉乘</p>
</li>
<li>
<p>变换</p>
<ul>
<li>观测变换（View Transformation）</li>
<li>投影变换（Rejection Transformation）
<ul>
<li>正交投影</li>
<li>透视投影</li>
</ul>
</li>
<li>视点变换（Viewport Transformation）</li>
</ul>
</li>
<li>
<p>光栅化与反走样</p>
<ul>
<li>采样</li>
<li>信号处理复习</li>
<li>反走样策略</li>
<li>反走样算法</li>
<li>可见性</li>
</ul>
</li>
<li>
<p>着色</p>
<ul>
<li>Blinn-Phong 反射模型</li>
<li>着色频率</li>
</ul>
</li>
<li>
<p>图形管线（实时渲染管线）</p>
</li>
<li>
<p>纹理映射</p>
<ul>
<li>uv值</li>
<li>插值</li>
<li>纹理图片过小的情况（uv值是小数）
<ul>
<li>四舍五入</li>
<li>双线性插值</li>
<li>双立方插值</li>
</ul>
</li>
<li>纹理图片过大的情况
<ul>
<li>用像素对应uv坐标的颜色来填充像素</li>
<li>近点：一个像素反映纹理的一小块 =&gt; 锯齿</li>
<li>远点：一个像素反映纹理的一大块 =&gt; 摩尔纹</li>
<li>MSAA 可行但代价太大</li>
<li>不采样：用区域均值填充整个像素</li>
<li>如何查询纹理中一片区域的均值
<ul>
<li>Mipmap =&gt; 远端 overblur</li>
<li>各向异性过滤</li>
<li>EWA 过滤</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<a class="post-dummy-target" id="二叉乘"></a><h2>二、叉乘</h2>
<a class="post-dummy-target" id="21-叉乘的定义"></a><h3>2.1 叉乘的定义</h3>
<p>$$
\vec a \times \vec b = 
\begin{bmatrix}
y_a z_b - y_b z_a \\ 
z_a x_b - z_b x_a \\ 
x_a y_b - x_b y_a 
\end{bmatrix} 
$$</p>
<a class="post-dummy-target" id="22-叉乘的矩阵表示"></a><h3>2.2 叉乘的矩阵表示</h3>
<p>$$
\vec a \times \vec b = 
\begin{bmatrix}
0   &amp; -z_a &amp;  y_a  \\ 
z_a &amp;  0    &amp; -x_a \\ 
-y_a &amp;  x_a  &amp;  0   \\ 
\end{bmatrix}
\begin{bmatrix}
x_b \\ 
y_b \\ 
z_b \\ 
\end{bmatrix}
$$</p>
<a class="post-dummy-target" id="23-叉乘的模长"></a><h3>2.3 叉乘的模长</h3>
<p>$$
|| \vec a \times \vec b || = ||\vec a|| \cdot ||\vec b || \cdot \sin&lt;\vec a, \vec b&gt;
$$</p>
<a class="post-dummy-target" id="24-叉乘的应用"></a><h3>2.4 叉乘的应用</h3>
<a class="post-dummy-target" id="241-用于判断左右"></a><h4>2.4.1 用于判断左右</h4>
<p>$$
|| \vec a \times \vec b || \iff \vec b 在 \vec a 的左侧
$$</p>
<a class="post-dummy-target" id="242-用于判断三角形内外"></a><h4>2.4.2 用于判断三角形内外</h4>
<p>&ldquo;$P$ 在 $AB$ 左侧&rdquo; 且 &ldquo;$P$ 在 $BC$ 左侧&rdquo; 且 &ldquo;$P$ 在 $CA$ 左侧&rdquo; $\implies$ $P$ 在 $\triangle ABC$ 内部</p>
<p>&ldquo;$P$ 在 $AB$ 右侧&rdquo; 且 &ldquo;$P$ 在 $BC$ 右侧&rdquo; 且 &ldquo;$P$ 在 $CA$ 右侧&rdquo; $\implies$ $P$ 在 $\triangle ABC$ 内部</p>
<a class="post-dummy-target" id="三变换"></a><h2>三、变换</h2>
<a class="post-dummy-target" id="31-二维仿射变换"></a><h3>3.1 二维仿射变换</h3>
<a class="post-dummy-target" id="311-二维缩放变换"></a><h4>3.1.1 二维缩放变换</h4>
<p>$$
\begin{bmatrix}
x^{'} \\ 
y^{'} \\ 
\end{bmatrix}
= \begin{bmatrix}
s_x &amp; 0    \\ 
0   &amp; s_y  \\ 
\end{bmatrix}
\begin{bmatrix}
x \\ 
y \\ 
\end{bmatrix}
$$</p>
<a class="post-dummy-target" id="312-二维对称变换"></a><h4>3.1.2 二维对称变换</h4>
<p>$$
\begin{bmatrix}
x^{'} \\ 
y^{'} \\ 
\end{bmatrix}
= \begin{bmatrix}
-1 &amp; 0 \\ 
0   &amp; 1 \\ 
\end{bmatrix}
\begin{bmatrix}
x \\ 
y \\ 
\end{bmatrix}
$$</p>
<a class="post-dummy-target" id="313-二维切变变换"></a><h4>3.1.3 二维切变变换</h4>
<p>$$
\begin{bmatrix}
x^{'} \\ 
y^{'}
\end{bmatrix}
= \begin{bmatrix}
1   &amp; a \\ 
0   &amp; 1 
\end{bmatrix}
\begin{bmatrix}
x \\ 
y 
\end{bmatrix}
$$</p>
<a class="post-dummy-target" id="314-二维旋转变换"></a><h4>3.1.4 二维旋转变换</h4>
<p>$$
\begin{bmatrix}
x^{'} \\ 
y^{'}
\end{bmatrix}
= \begin{bmatrix}
\cos \theta  &amp; - \sin \theta \\ 
\sin \theta  &amp;   \cos \theta 
\end{bmatrix}
\begin{bmatrix}
x \\ 
y 
\end{bmatrix}
$$</p>
<p>旋转变换矩阵</p>
<p>$$
R_\theta = \begin{bmatrix}
\cos \theta  &amp; - \sin \theta \\ 
\sin \theta  &amp;   \cos \theta 
\end{bmatrix}
$$</p>
<p>的逆变换
$$
R_{\theta}^{-1} = R_{-\theta} 
= \begin{bmatrix}
\cos \theta  &amp;   \sin \theta \\ 
-\sin \theta  &amp;   \cos \theta \\ 
\end{bmatrix}
= R_\theta^T
$$
说明旋转变换矩阵是正交矩阵。</p>
<p>注意到，以上都能统一表示为如下形式
$$
\begin{bmatrix}
x^{'} \\ 
y^{'}
\end{bmatrix}
= \begin{bmatrix}
a  &amp; b \\ 
c  &amp; d 
\end{bmatrix}
\begin{bmatrix}
x \\ 
y 
\end{bmatrix}
$$</p>
<p>称之为线性变换。</p>
<a class="post-dummy-target" id="315-二维平移变换"></a><h4>3.1.5 二维平移变换</h4>
<p>$$
\begin{bmatrix}
x^{'} \\ 
y^{'} \\ 
\end{bmatrix}
= \begin{bmatrix}
1  &amp; 0 \\ 
0  &amp; 1 \\ 
\end{bmatrix}
\begin{bmatrix}
x \\ 
y \\ 
\end{bmatrix}
+\begin{bmatrix}
t_x \\ 
t_y \\ 
\end{bmatrix}
$$</p>
<p>不能再表示为之前统一的表示形式！那么仿射变换的统一表示形式必须为
$$
\begin{bmatrix}
x^{'} \\ 
y^{'} \\ 
\end{bmatrix}
=\begin{bmatrix}
a  &amp; b \\ 
c  &amp; d \\ 
\end{bmatrix}
\begin{bmatrix}
x \\ 
y \\ 
\end{bmatrix}
+\begin{bmatrix}
t_x \\ 
t_y \\ 
\end{bmatrix}
$$</p>
<a class="post-dummy-target" id="32-齐次坐标"></a><h3>3.2 齐次坐标</h3>
<p>定义二维点的坐标：$(x, y, 1)^T$</p>
<p>定义二维向量的坐标：$(x, y, 0)^T$</p>
<p>规定齐次坐标 $(x, y, w)^T = (x/w, y/w, 1)$</p>
<p>从点与向量之间的加减法可理解齐次坐标</p>
<ol>
<li>向量 + 向量 = 向量</li>
<li>点     - 点     = 向量</li>
<li>点    + 向量 = 点</li>
<li>点    + 点     = 中点</li>
</ol>
<p>这样的话，一切仿射变换（先线性变换，再平移变换）</p>
<p>$$
\begin{bmatrix}
x^{'} \\ 
y^{'} \\ 
\end{bmatrix}
=\begin{bmatrix}
a  &amp; b \\ 
c  &amp; d \\ 
\end{bmatrix}
\begin{bmatrix}
x \\ 
y \\ 
\end{bmatrix}
+\begin{bmatrix}
t_x \\ 
t_y \\ 
\end{bmatrix}
$$</p>
<p>可统一表示为以下形式</p>
<p>$$
\begin{bmatrix}
x^{'} \\ 
y^{'} \\ 
1     \\ 
\end{bmatrix}
=\begin{bmatrix}
a  &amp; b &amp; t_x \\ 
c  &amp; d &amp; t_y \\ 
0  &amp; 0 &amp; 1 
\end{bmatrix}
\begin{bmatrix}
x \\ 
y \\ 
1 
\end{bmatrix}
$$</p>
<a class="post-dummy-target" id="33-三维变换"></a><h3>3.3 三维变换</h3>
<a class="post-dummy-target" id="331-三维齐次坐标"></a><h4>3.3.1 三维齐次坐标</h4>
<p>（略）</p>
<a class="post-dummy-target" id="332-三维旋转变换"></a><h4>3.3.2 三维旋转变换</h4>
<p>绕 $x$ 轴旋转：$x$ 坐标不变，在平行于 $Oyz$ 平面上绕点 $(x, 0, 0)$ 旋转
$$
R_x(\theta) = \begin{bmatrix}
1            &amp;   0            &amp; 0             &amp; 0  \\ 
0            &amp;   \cos \theta  &amp; - \sin \theta &amp; 0  \\ 
0            &amp;   \sin \theta  &amp;   \cos \theta &amp; 0  \\ 
0            &amp;   0            &amp;   0           &amp; 1 
\end{bmatrix}
$$</p>
<p>绕 $y$ 轴旋转：$y$ 坐标不变，在平行于 $Ozx$ 平面上绕点 $(0, y, 0)$ 旋转（注意是先 $z$ 后 $x$）</p>
<p>$$
R_y(\theta) = \begin{bmatrix}
\cos \theta  &amp;   0            &amp;   \sin \theta &amp; 0  \\ 
0            &amp;   1            &amp;   0           &amp; 0  \\ 
-\sin \theta &amp;   0            &amp;   \cos \theta &amp; 0  \\ 
0            &amp;   0            &amp;   0            &amp; 1 
\end{bmatrix}
$$</p>
<a class="post-dummy-target" id="333-rodrigues-旋转公式"></a><h4>3.3.3 Rodrigues&rsquo; 旋转公式</h4>
<p>绕 $\vec n$ 旋转 $\alpha$ 角度，旋转矩阵
$$
R(\vec n, \alpha) = \cos \alpha \cdot I + (1 - \cos \alpha) \vec n \cdot \vec n^T + \sin \alpha 
\begin{bmatrix}
0    &amp; - n_z  &amp;  n_y \\ 
n_z  &amp;   0    &amp; -n_x \\ 
-n_y  &amp;   n_x  &amp;  0
\end{bmatrix}
$$</p>
<a class="post-dummy-target" id="34-观测变换"></a><h3>3.4 观测变换</h3>
<p>大纲</p>
<ul>
<li>视图变换</li>
<li>投影变换
<ul>
<li>正交投影</li>
<li>透视投影</li>
</ul>
</li>
<li>视点变换</li>
</ul>
<a class="post-dummy-target" id="341-视图变换"></a><h4>3.4.1 视图变换</h4>
<p>首先我们需要定义一个标准坐标系，才能准确定位每一个对象的位置和状态。为了方便，我们定义标准坐标系如下：</p>
<ul>
<li>相机位置为左边原点</li>
<li>相机朝向为 $-z$ 方向</li>
<li>相机向上方向为 $y$ 方向</li>
<li>$x$ 正方向由右手坐标系确定，即 $x = y \times z$</li>
</ul>
<p>视图变换的目标就是将任意坐标系中的所有对象映射到标准坐标系。由于我们是要对所有对象执行相同的变换，我们所求得的对相机的变换方式就是对整个空间的变换方式。</p>
<p>对相机进行如下变换可以使其达到标准坐标系中的状态：</p>
<ol>
<li>从原位置 $\vec e$ 平移到原点</li>
<li>旋转朝向从 $\vec g$ 方向到 $-z$ 方向</li>
<li>旋转向上方向从 $\vec t$ 方向到 $y$ 方向</li>
<li>旋转正交方向从 $\vec g \times \vec t$ 方向到 $x$ 方向</li>
</ol>
<p>其中第一步平移变换矩阵容易求得：</p>
<p>$$
T_{view} 
= \begin{bmatrix} 
1 &amp; 0 &amp; 0 &amp; -x_e \\ 
0 &amp; 1 &amp; 0 &amp; -y_e \\ 
0 &amp; 0 &amp; 1 &amp; -z_e \\ 
0 &amp; 0 &amp; 0 &amp;  1   \\ 
\end{bmatrix}
$$</p>
<p>但 2-4 步的旋转变换矩阵难以直接求得，但其逆变换
2. 旋转朝向从 $-z$ 方向到 $\vec g$ 方向
3. 旋转向上方向从 $y$ 方向到 $\vec t$ 方向
4. 旋转正交方向从 $x$ 方向到 $\vec g \times \vec t$ 方向</p>
<p>很容易得到:</p>
<p>$$
R_{view}^{-1} 
= \begin{bmatrix} 
x_{\vec g \times \vec t} &amp; x_{\vec t} &amp; x_{-\vec g} &amp; 0 \\ 
y_{\vec g \times \vec t} &amp; y_{\vec t} &amp; y_{-\vec g} &amp; 0 \\ 
z_{\vec g \times \vec t} &amp; z_{\vec t} &amp; z_{-\vec g} &amp; 0 \\ 
0                        &amp; 0          &amp; 0           &amp; 1   \\ 
\end{bmatrix}
$$</p>
<p>由于旋转矩阵是正交矩阵，即 $R_{view}^{-1} = R_{view}^{T} $，因此有</p>
<p>$$
R_{view} = (R_{view}^{-1})^T 
= \begin{bmatrix} 
x_{\vec g \times \vec t} &amp; y_{\vec g \times \vec t} &amp; z_{\vec g \times \vec t} &amp; 0 \\ 
x_{\vec t}               &amp; y_{\vec t}               &amp; z_{\vec t}               &amp; 0 \\ 
x_{-\vec g}              &amp; y_{-\vec g}              &amp; z_{-\vec g}              &amp; 0 \\ 
0 &amp; 0 &amp; 0 &amp; 1   \\ 
\end{bmatrix}
$$</p>
<p>综上，视图变换矩阵为</p>
<p>$$
R_{view} \cdot T_{view}
= \begin{bmatrix} 
x_{\vec g \times \vec t} &amp; y_{\vec g \times \vec t} &amp; z_{\vec g \times \vec t} &amp; 0 \\ 
x_{\vec t}               &amp; y_{\vec t}               &amp; z_{\vec t}               &amp; 0 \\ 
x_{-\vec g}              &amp; y_{-\vec g}              &amp; z_{-\vec g}              &amp; 0 \\ 
0 &amp; 0 &amp; 0 &amp; 1   \\ 
\end{bmatrix} \cdot 
\begin{bmatrix} 
1 &amp; 0 &amp; 0 &amp; -x_e \\ 
0 &amp; 1 &amp; 0 &amp; -y_e \\ 
0 &amp; 0 &amp; 1 &amp; -z_e \\ 
0 &amp; 0 &amp; 0 &amp;  1   \\ 
\end{bmatrix}
$$</p>
<a class="post-dummy-target" id="342-投影变换"></a><h4>3.4.2 投影变换</h4>
<a class="post-dummy-target" id="3421-正交投影变换"></a><h5>3.4.2.1 正交投影变换</h5>
<p><figure><img src="/svg/loading.min.svg" data-sizes="auto" data-src="https://gitee.com/DiracLee/picbed/raw/master/img/20201207145836.png" alt="" class="lazyload"></figure></p>
<p>将场景立方体 $[l, r] \times [b, t] \times [f, n]$ 投影到标准立方体 $[-1, 1]^3$，需要两步：</p>
<ol>
<li>将场景立方体平移，直至其以原点为中心</li>
<li>将场景立方体缩放至标准立方体</li>
</ol>
<p>因此，正交投影变换矩阵为：
$$
R_{ortho} 
= \begin{bmatrix} 
\frac {2} {r-l} &amp; 0               &amp; 0               &amp; 0 \\ 
0               &amp; \frac {2} {t-b} &amp; 0               &amp; 0 \\ 
0               &amp; 0               &amp; \frac {2} {n-f} &amp; 0 \\ 
0 &amp; 0 &amp; 0 &amp; 1   \\ 
\end{bmatrix} \cdot 
\begin{bmatrix} 
1 &amp; 0 &amp; 0 &amp; -\frac {r + l} {2} \\ 
0 &amp; 1 &amp; 0 &amp; -\frac {t + b} {2} \\ 
0 &amp; 0 &amp; 1 &amp; -\frac {n + f} {2} \\ 
0 &amp; 0 &amp; 0 &amp;  1   \\ 
\end{bmatrix}
$$</p>
<a class="post-dummy-target" id="3422-透视投影变换"></a><h5>3.4.2.2 透视投影变换</h5>
<p><figure><img src="/svg/loading.min.svg" data-sizes="auto" data-src="https://gitee.com/DiracLee/picbed/raw/master/img/20201207150747.png" alt="" class="lazyload"></figure></p>
<p>由上图可以看出，透视投影比正交投影看起来更加真实。</p>
<p><figure><img src="/svg/loading.min.svg" data-sizes="auto" data-src="https://gitee.com/DiracLee/picbed/raw/master/img/20201207152415.png" alt="" class="lazyload"></figure></p>
<p>因此，我们的场景空间应当是一个棱台。</p>
<p>我们需要先要把一个棱台状的场景空间 Frustum 映射为立方体空间 Cuboid，然后对该立方体进行正交投影，这样才能看起来更加真实。</p>
<a class="post-dummy-target" id="343-视点变换"></a><h4>3.4.3 视点变换</h4>
<a class="post-dummy-target" id="四光栅化"></a><h2>四、光栅化</h2>
<a class="post-dummy-target" id="41-采样"></a><h3>4.1 采样</h3>
<a class="post-dummy-target" id="42-信号处理复习"></a><h3>4.2 信号处理复习</h3>
<a class="post-dummy-target" id="43-反走样策略"></a><h3>4.3 反走样策略</h3>
<a class="post-dummy-target" id="44反走样算法"></a><h3>4.4反走样算法</h3>
<a class="post-dummy-target" id="45可见性"></a><h3>4.5可见性</h3></div><div class="post-footer" id="post-footer">
    <div class="post-info">
        <div class="post-info-line">
            <div class="post-info-mod">
                <span>本文于 2020-12-04 更新</span>
            </div>
            <div class="post-info-license"></div>
        </div>
        <div class="post-info-line">
            <div class="post-info-md"></div>
            <div class="post-info-share"><span><a href="//www.linkedin.com/shareArticle?url=https%3a%2f%2fdiraclee.gitee.io%2f2020%2f12%2f%25E7%258E%25B0%25E4%25BB%25A3%25E8%25AE%25A1%25E7%25AE%2597%25E6%259C%25BA%25E5%259B%25BE%25E5%25BD%25A2%25E5%25AD%25A6%25E5%2585%25A5%25E9%2597%25A8%2f&amp;title=%e7%8e%b0%e4%bb%a3%e8%ae%a1%e7%ae%97%e6%9c%ba%e5%9b%be%e5%bd%a2%e5%ad%a6%e5%85%a5%e9%97%a8" target="_blank" title="分享到 LinkedIn">
            <i class="fab fa-linkedin fa-fw"></i>
        </a><a href="//service.weibo.com/share/share.php?url=https%3a%2f%2fdiraclee.gitee.io%2f2020%2f12%2f%25E7%258E%25B0%25E4%25BB%25A3%25E8%25AE%25A1%25E7%25AE%2597%25E6%259C%25BA%25E5%259B%25BE%25E5%25BD%25A2%25E5%25AD%25A6%25E5%2585%25A5%25E9%2597%25A8%2f&amp;appkey=&amp;title=%e7%8e%b0%e4%bb%a3%e8%ae%a1%e7%ae%97%e6%9c%ba%e5%9b%be%e5%bd%a2%e5%ad%a6%e5%85%a5%e9%97%a8" target="_blank" title="分享到 Weibo">
            <i class="fab fa-weibo fa-fw"></i>
        </a></span></div>
        </div>
    </div>

    <div class="post-info-more">
        <section><span class="tag">
                        <a href="https://diraclee.gitee.io/tags/%E5%85%A5%E9%97%A8/"><i class="fas fa-tag fa-fw"></i>&nbsp;入门</a>&nbsp;
                    </span><span class="tag">
                        <a href="https://diraclee.gitee.io/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9B%BE%E5%BD%A2%E5%AD%A6/"><i class="fas fa-tag fa-fw"></i>&nbsp;计算机图形学</a>&nbsp;
                    </span></section>
        <section>
            <span><a href="javascript:window.history.back();">返回</a></span>&nbsp;|&nbsp;<span><a href="https://diraclee.gitee.io">主页</a></span>
        </section>
    </div>

    <div class="post-nav"><a href="https://diraclee.gitee.io/2020/12/%E6%8E%A8%E8%8D%90%E7%B3%BB%E7%BB%9F%E7%BB%BC%E8%BF%B0/" class="prev" rel="prev" title="推荐系统综述"><i class="fas fa-angle-left fa-fw"></i>推荐系统综述</a>
            <a href="https://diraclee.gitee.io/2020/12/%E5%85%83%E5%AD%A6%E4%B9%A0%E6%A6%82%E8%A7%88/" class="next" rel="next" title="元学习概览">元学习概览<i class="fas fa-angle-right fa-fw"></i></a></div>
</div><div class="post-comment"></div>
    </article></div>
            </main><footer class="footer">
    <div class="copyright"><div class="copyright-line">由 <a href="https://gohugo.io/" target="_blank" rel="external nofollow noopener noreffer">Hugo</a> 强力驱动 | 主题 - <a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="external nofollow noopener noreffer">LoveIt<i class="far fa-heart fa-fw"></i></a>
        </div>

        <div class="copyright-line"><i class="far fa-copyright fa-fw"></i><span itemprop="copyrightYear">2020</span><span class="author" itemprop="copyrightHolder">&nbsp;<a href="https://diraclee.gitee.io" target="_blank">Dirac Lee</a></span>&nbsp;|&nbsp;<span class="license"><a rel="license external nofollow noopener noreffer" href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank">CC BY-NC 4.0</a></span></div>
    </div>
</footer></div><a href="#" class="dynamic-to-top" id="dynamic-to-top" data-scroll>
            <span>&nbsp;</span>
        </a><script src="/js/lib/jquery/jquery.slim.min.js"></script><script src="/js/lib/lazysizes/lazysizes.min.js"></script><script src="/js/lib/smooth-scroll/smooth-scroll.polyfills.min.js"></script><script>window.scroll = new SmoothScroll('[data-scroll]', {speed: 300, speedAsDuration: true});</script><link rel="stylesheet" href="/css/lib/katex/katex.min.css"><script src="/js/lib/katex/katex.min.js"></script><script defer src="/js/lib/katex/auto-render.min.js"></script><link rel="stylesheet" href="/css/lib/katex/copy-tex.min.css"><script defer src="/js/lib/katex/copy-tex.min.js"></script><script defer src="/js/lib/katex/mhchem.min.js"></script><script>
        document.addEventListener("DOMContentLoaded", function () {
            renderMathInElement(document.body, {
                delimiters: [
                    { left: "$$", right: "$$", display: true },
                    { left: "\\(", right: "\\)", display: false },
                    { left: "\\[", right: "\\]", display: true },{ left: "$", right: "$", display: false },]
            });
        });
    </script><script src="/js/blog.min.js"></script></body>
</html>